

include ../../../GDALmake.opt

CORE_OBJ =	gmlpropertydefn.o gmlfeatureclass.o gmlfeature.o gmlreader.o \
		parsexsd.o resolvexlinks.o hugefileresolver.o gmlutils.o \
		gmlreadstate.o gmlhandler.o gfstemplate.o gmlregistry.o

OGR_OBJ =	ogrgmldriver.o ogrgmldatasource.o ogrgmllayer.o

OBJ =	$(CORE_OBJ) $(OGR_OBJ)

CPPFLAGS :=	-iquote .. -iquote ../..  $(XERCES_INCLUDE) $(EXPAT_INCLUDE) $(SQLITE_INC) $(CPPFLAGS)
#CFLAGS	:=	$(filter-out -Wall,$(CFLAGS))

ifeq ($(HAVE_XERCES),yes)
CPPFLAGS +=  -DHAVE_XERCES
endif

ifeq ($(HAVE_EXPAT),yes)
CPPFLAGS +=  -DHAVE_EXPAT
endif

ifeq ($(HAVE_SQLITE),yes)
CPPFLAGS +=  -DHAVE_SQLITE
endif

# By default, XML validation is disabled.  Uncomment the following line to
# enable XML schema validation in the parser.
#CPPFLAGS +=  -DOGR_GML_VALIDATION=1

default:	$(O_OBJ:.o=.$(OBJ_EXT))

clean:
	rm -f *.o gmlview $(O_OBJ)

gmlview:	gmlview.cpp $(CORE_OBJ:.o=.$(OBJ_EXT))
	$(CXX) $(CPPFLAGS) $(CFLAGS) $(LNK_FLAGS) \
		gmlview.cpp $(CORE_OBJ:.o=.$(OBJ_EXT)) $(GDAL_LIB) $(LIBS) \
		-o gmlview

$(O_OBJ):	ogr_gml.h gmlreader.h gmlreaderp.h
